<?php
namespace app\api\controller;
use think\facade\View;
use think\facade\Db;
use think\facade\Request;
class Index  extends \app\api\controller\Member{
    public function __construct(\think\App $app) {
        parent::__construct($app);
        View::assign("pagetitle",config("setting.pagetitle"));//pagetitle
        View::assign("keywords",config("setting.keywords"));//关键词
        View::assign("description",config("setting.description"));//描述
    }
    public function index()
    {
        //模板
        $template_id=Db::name("template")->where("isdefault=1")->order("sort asc")->value("template_id");
        if(!$template_id){
            $this->error("模板不存在");
        }
        return View::fetch(base_path().'data/templateFile/'.$template_id.".html");
    }
    public function test(){
        $this->success("ok");
    }
}
